-- Author: Rostal
-- Last edit date: 2022/8/1

util.require_natives("natives-1651208000")
util.require_natives("natives-1640181023")

--- --- --- Functions --- --- ---


function IS_PED_PLAYER(Ped)
    if PED.GET_PED_TYPE(Ped) >= 4 then
        return false
    else
        return true
    end
end

function TELEPORT(X, Y, Z)
    local Me = PLAYER.GET_PLAYER_PED_SCRIPT_INDEX(PLAYER.PLAYER_ID())
    if PED.GET_VEHICLE_PED_IS_IN(Me, false) == 0 then
        ENTITY.SET_ENTITY_COORDS(Me, X, Y, Z)
    else
        ENTITY.SET_ENTITY_COORDS(PED.GET_VEHICLE_PED_IS_IN(Me, false), X, Y, Z)
    end
end

vect = {
    ['new'] = function(x, y, z)
        return { ['x'] = x, ['y'] = y, ['z'] = z }
    end,
    ['subtract'] = function(a, b)
        return vect.new(a.x - b.x, a.y - b.y, a.z - b.z)
    end,
    ['add'] = function(a, b)
        return vect.new(a.x + b.x, a.y + b.y, a.z + b.z)
    end,
    ['mag'] = function(a)
        return math.sqrt(a.x ^ 2 + a.y ^ 2 + a.z ^ 2)
    end,
    ['norm'] = function(a)
        local mag = vect.mag(a)
        return vect.div(a, mag)
    end,
    ['mult'] = function(a, b)
        return vect.new(a.x * b, a.y * b, a.z * b)
    end,
    ['div'] = function(a, b)
        return vect.new(a.x / b, a.y / b, a.z / b)
    end,
    ['dist'] = function(a, b)
        --returns the distance between two vectors
        return vect.mag(vect.subtract(a, b))
    end
}


--returns a list of nearby vehicles given player Id
function GET_NEARBY_VEHICLES(pid, radius)
    local vehicles = {}
    local p = PLAYER.GET_PLAYER_PED_SCRIPT_INDEX(pid)
    local pos = ENTITY.GET_ENTITY_COORDS(p)
    local v = PED.GET_VEHICLE_PED_IS_IN(p, false)
    for k, vehicle in pairs(entities.get_all_vehicles_as_handles()) do
        local veh_pos = ENTITY.GET_ENTITY_COORDS(vehicle)
        if vehicle ~= v and vect.dist(pos, veh_pos) <= radius then
            table.insert(vehicles, vehicle)
        end
    end
    return vehicles
end

--returns a list of nearby peds given player Id
function GET_NEARBY_PEDS(pid, radius)
    local peds = {}
    local p = PLAYER.GET_PLAYER_PED_SCRIPT_INDEX(pid)
    local pos = ENTITY.GET_ENTITY_COORDS(p)
    for k, ped in pairs(entities.get_all_peds_as_handles()) do
        if ped ~= p then
            local ped_pos = ENTITY.GET_ENTITY_COORDS(ped)
            if vect.dist(pos, ped_pos) <= radius then
                table.insert(peds, ped)
            end
        end
    end
    return peds
end

--返回瞄准的实体
local GetEntity_PlayerIsAimingAt = function(p)
    local ent = NULL
    if PLAYER.IS_PLAYER_FREE_AIMING(p) then
        local ptr = memory.alloc_int()
        if PLAYER.GET_ENTITY_PLAYER_IS_FREE_AIMING_AT(p, ptr) then
            ent = memory.read_int(ptr)
        end
        memory.free(ptr)
        if ENTITY.IS_ENTITY_A_PED(ent) and PED.IS_PED_IN_ANY_VEHICLE(ent) then
            local vehicle = PED.GET_VEHICLE_PED_IS_IN(ent, false)
            ent = vehicle
        end
    end
    return ent
end
--为实体添加小地图标记
function addBlipForEntity(entity, blipSprite, colour)
    local blip = HUD.ADD_BLIP_FOR_ENTITY(entity)
    HUD.SET_BLIP_SPRITE(blip, blipSprite)
    HUD.SET_BLIP_COLOUR(blip, colour)
    HUD.SHOW_HEIGHT_ON_BLIP(blip, false)
    HUD.SET_BLIP_ROTATION(blip, SYSTEM.CEIL(ENTITY.GET_ENTITY_HEADING(entity)))
    NETWORK.SET_NETWORK_ID_CAN_MIGRATE(entity, false)
    util.create_thread(function()
        while not ENTITY.IS_ENTITY_DEAD(entity) do
            local heading = ENTITY.GET_ENTITY_HEADING(entity)
            HUD.SET_BLIP_ROTATION(blip, SYSTEM.CEIL(heading))
            util.yield()
        end
        util.remove_blip(blip)
    end)
    return blip
end
------ STAT Functions ---
function MP_INDEX()
    return "MP" .. util.get_char_slot() .. "_"
end

function IS_MPPLY(Stat)
    if string.find(Stat, "MPPLY_") or string.find(Stat, "MP_") then
        return true
    else
        return false
    end
end

function STAT_SET_INT(Stat, Value)
    if IS_MPPLY(Stat) then
        STATS.STAT_SET_INT(util.joaat(Stat), Value, true)
    else
        STATS.STAT_SET_INT(util.joaat(MP_INDEX() .. Stat), Value, true)
    end
end

function STAT_SET_FLOAT(Stat, Value)
    if string.find(Stat, "MPPLY_") or string.find(Stat, "MP_") then
        STATS.STAT_SET_FLOAT(util.joaat(Stat), Value, true)
    else
        STATS.STAT_SET_FLOAT(util.joaat(MP_INDEX() .. Stat), Value, true)
    end
end

function STAT_SET_BOOL(Stat, Value)
    if string.find(Stat, "MPPLY_") or string.find(Stat, "MP_") then
        STATS.STAT_SET_BOOL(util.joaat(Stat), Value, true)
    else
        STATS.STAT_SET_BOOL(util.joaat(MP_INDEX() .. Stat), Value, true)
    end
end

function STAT_SET_INCREMENT(Stat, Value)
    if string.find(Stat, "MPPLY_") or string.find(Stat, "MP_") then
        STATS.STAT_INCREMENT(util.joaat(Stat), Value, true)
    else
        STATS.STAT_INCREMENT(util.joaat(MP_INDEX() .. Stat), Value, true)
    end
end

function STAT_GET_INT(Stat)
    local IntPTR = memory.alloc(4)

    if string.find(Stat, "MPPLY_") or string.find(Stat, "MP_") then
        STATS.STAT_GET_INT(util.joaat(Stat), IntPTR, -1)
    else
        STATS.STAT_GET_INT(util.joaat(MP_INDEX() .. Stat), IntPTR, -1)
    end

    return memory.read_int(IntPTR)
end

function STAT_GET_FLOAT(Stat)
    local FloatPTR = memory.alloc(4)

    if string.find(Stat, "MPPLY_") or string.find(Stat, "MP_") then
        STATS.STAT_GET_FLOAT(util.joaat(Stat), FloatPTR, -1)
    else
        STATS.STAT_GET_FLOAT(util.joaat(MP_INDEX() .. Stat), FloatPTR, -1)
    end

    return tonumber(string.format("%.3f", memory.read_float(FloatPTR)))
end

function STAT_GET_BOOL(Stat)
    local BoolPTR = memory.alloc(1)

    if string.find(Stat, "MPPLY_") or string.find(Stat, "MP_") then
        STATS.STAT_GET_BOOL(util.joaat(Stat), BoolPTR, -1)
    else
        STATS.STAT_GET_BOOL(util.joaat(MP_INDEX() .. Stat), BoolPTR, -1)
    end

    if memory.read_byte(BoolPTR) == 1 then
        return "true"
    else
        return "false"
    end
end

--- GLOBAL Functions ---
function SET_INT_GLOBAL(Global, Value)
    memory.write_int(memory.script_global(Global), Value)
end

function SET_FLOAT_GLOBAL(Global, Value)
    memory.write_float(memory.script_global(Global), Value)
end

-- GET
function GET_INT_GLOBAL(Global)
    return memory.read_int(memory.script_global(Global))
end

function SET_PACKED_INT_GLOBAL(StartGlobal, EndGlobal, Value)
    for i = StartGlobal, EndGlobal do
        SET_INT_GLOBAL(262145 + i, Value)
    end
end

function SET_INT_LOCAL(Script, Local, Value)
    if memory.script_local(Script, Local) ~= 0 then
        memory.write_int(memory.script_local(Script, Local), Value)
    end
end

function SET_FLOAT_LOCAL(Script, Local, Value)
    if memory.script_local(Script, Local) ~= 0 then
        memory.write_float(memory.script_local(Script, Local), Value)
    end
end

-- GET
function GET_INT_LOCAL(Script, Local)
    if memory.script_local(Script, Local) ~= 0 then
        return memory.read_int(memory.script_local(Script, Local))
    end
end

---
util.keep_running()



-------------------------------
---------- 周围实体选项 ----------
-------------------------------

local entity_options = menu.list(menu.my_root(), "周围实体选项", {}, "")

local NEAR_PED_CAM = menu.list(entity_options, "管理附近的NPC和摄像头", {}, "来自Heist Control")

menu.divider(NEAR_PED_CAM, "设置")

local HostilePed = false
menu.toggle(NEAR_PED_CAM, "只对怀有敌意的NPC有效", {}, "启用：只对怀有敌意的NPC生效" .. "\n" .. "禁用：对所有NPC生效", function(Toggle)
    HostilePedToggle = Toggle

    if HostilePedToggle then
        HostilePed = true
    else
        HostilePed = false
    end
end)

-----
menu.divider(NEAR_PED_CAM, "NPC选项")

menu.action(NEAR_PED_CAM, "移除NPC武器", {}, "", function()
    for k, ent in pairs(entities.get_all_peds_as_handles()) do
        if not IS_PED_PLAYER(ent) then
            if HostilePed then
                if PED.IS_PED_IN_COMBAT(ent, PLAYER.PLAYER_ID()) then
                    WEAPON.REMOVE_ALL_PED_WEAPONS(ent, true)
                end
            else
                WEAPON.REMOVE_ALL_PED_WEAPONS(ent, true)
            end
        end
    end
end)

menu.action(NEAR_PED_CAM, "删除所有NPC", {}, "", function()
    for k, ent in pairs(entities.get_all_peds_as_handles()) do
        if not IS_PED_PLAYER(ent) then
            if HostilePed then
                if PED.IS_PED_IN_COMBAT(ent, PLAYER.PLAYER_ID()) then
                    entities.delete_by_handle(ent)
                end
            else
                entities.delete_by_handle(ent)
            end
        end
    end
end)

menu.action(NEAR_PED_CAM, "杀死所有NPC", {}, "", function()
    for k, ent in pairs(entities.get_all_peds_as_handles()) do
        if not IS_PED_PLAYER(ent) then
            if HostilePed then
                if PED.IS_PED_IN_COMBAT(ent, PLAYER.PLAYER_ID()) then
                    ENTITY.SET_ENTITY_HEALTH(ent, 0.0)
                end
            else
                ENTITY.SET_ENTITY_HEALTH(ent, 0.0)
            end
        end
    end
end)

-----
menu.divider(NEAR_PED_CAM, "摄像头选项")

menu.action(NEAR_PED_CAM, "删除摄像头", {}, "几乎可以删除全部摄像头了", function()
    -- Credit goes to Leif.Erickson
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityModel = ENTITY.GET_ENTITY_MODEL(ent)
        local Cams = {
            -1233322078,
            168901740,
            -1095296451,
            -173206916,
            -1159421424,
            548760764,
            -1340405475,
            1449155105,
            -354221800,
            -1884701657,
            2090203758,
            -1007354661,
            -1842407088,
            289451089,
            3061645218
        }

        for i = 1, #Cams do
            if EntityModel == Cams[i] then
                entities.delete_by_handle(ent)
            end
        end
    end
end)

menu.action(NEAR_PED_CAM, "摄像头上天", {}, "上天了就拍不到你了", function()
    -- Credit goes to Leif.Erickson
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityModel = ENTITY.GET_ENTITY_MODEL(ent)
        local Cams = {
            -1233322078,
            168901740,
            -1095296451,
            -173206916,
            -1159421424,
            548760764,
            -1340405475,
            1449155105,
            -354221800,
            -1884701657,
            2090203758,
            -1007354661,
            -1842407088,
            289451089,
            3061645218
        }

        for i = 1, #Cams do
            if EntityModel == Cams[i] then
                local pos = ENTITY.GET_ENTITY_COORDS(ent)
                ENTITY.SET_ENTITY_COORDS(ent, pos.x, pos.y, pos.z + 20.0, true, false, false, false)
            end
        end
    end
end)

-- -- 附近载具
local NEARBY_VEHICLE = menu.list(entity_options, "管理附近载具", {}, "")

local radius_nearby_vehicle = 30
menu.slider(NEARBY_VEHICLE, "范围半径", { "radius_nearby_vehicle" }, "", 0, 1000, 30, 10, function(value)
    radius_nearby_vehicle = value
end)

menu.action(NEARBY_VEHICLE, "爆炸附近载具", {}, "", function()
    for k, vehicle in pairs(GET_NEARBY_VEHICLES(players.user(), radius_nearby_vehicle)) do
        VEHICLE.EXPLODE_VEHICLE(vehicle, true, true)
    end
end)

menu.divider(NEARBY_VEHICLE, "载具上天")

local launch_vehicle_height = 20
menu.slider(NEARBY_VEHICLE, "上天高度", { "launch_vehicle_height" }, "", 0, 1000, 20, 10, function(value)
    launch_vehicle_height = value
end)

local launch_vehicle_freeze = false
menu.toggle(NEARBY_VEHICLE, "冻结载具", {}, "", function(toggle)
    launch_vehicle_freeze = toggle
end)

menu.action(NEARBY_VEHICLE, "发射上天", {}, "", function()
    for k, vehicle in ipairs(GET_NEARBY_VEHICLES(players.user(), radius_nearby_vehicle)) do
        if vehicle ~= entities.get_user_vehicle_as_handle() then
            if launch_vehicle_freeze then
                ENTITY.FREEZE_ENTITY_POSITION(vehicle, true)
            end
            local pos = ENTITY.GET_ENTITY_COORDS(vehicle)
            ENTITY.SET_ENTITY_COORDS(vehicle, pos.x, pos.y, pos.z + launch_vehicle_height, false, false, false, false)
        end
    end
end)

-- -- 附近NPC
local NEARBY_PED = menu.list(entity_options, "管理附近NPC", {}, "")

local radius_nearby_ped = 30
menu.slider(NEARBY_PED, "范围半径", { "radius_nearby_ped" }, "", 0, 1000, 30, 10, function(value)
    radius_nearby_ped = value
end)

menu.divider(NEARBY_PED, "NPC上天")

local launch_ped_height = 20
menu.slider(NEARBY_PED, "上天高度", { "launch_ped_height" }, "", 0, 1000, 20, 10, function(value)
    launch_ped_height = value
end)

local launch_ped_freeze = false
menu.toggle(NEARBY_PED, "冻结NPC", {}, "", function(toggle)
    launch_ped_freeze = toggle
end)

menu.action(NEARBY_PED, "发射上天", {}, "", function()
    for k, ped in ipairs(GET_NEARBY_PEDS(players.user(), radius_nearby_ped)) do
        if not IS_PED_PLAYER(ped) then
            if launch_ped_freeze then
                ENTITY.FREEZE_ENTITY_POSITION(ped, true)
            end
            local pos = ENTITY.GET_ENTITY_COORDS(ped)
            ENTITY.SET_ENTITY_COORDS(ped, pos.x, pos.y, pos.z + launch_ped_height, false, false, false, false)
        end
    end
end)

---
menu.divider(NEARBY_PED, "NPC侦查视野")

local see_range = 0.0
menu.slider(NEARBY_PED, "视力范围", { "see_range" }, "", 0.0, 20.0, 0.0, 1.0, function(value)
    see_range = value
end)

local hear_range = 0.0
menu.slider(NEARBY_PED, "听力范围", { "hear_range" }, "", 0.0, 20.0, 0.0, 1.0, function(value)
    hear_range = value
end)

local peripheral_range = 0.0
menu.slider(NEARBY_PED, "锥形视野范围", { "peripheral_range" }, "", 0.0, 20.0, 0.0, 1.0, function(value)
    peripheral_range = value
end)

local highly_perceptive = false
menu.toggle(NEARBY_PED, "高度警觉性", {}, "", function(toggle)
    highly_perceptive = toggle
end)

menu.action(NEARBY_PED, "设置", {}, "直接是全部范围", function()
    for k, ped in ipairs(entities.get_all_peds_as_handles()) do
        if not IS_PED_PLAYER(ped) then
            PED.SET_PED_SEEING_RANGE(ped, see_range)
            PED.SET_PED_HEARING_RANGE(ped, hear_range)
            PED.SET_PED_VISUAL_FIELD_PERIPHERAL_RANGE(ped, peripheral_range)
            PED.SET_PED_HIGHLY_PERCEPTIVE(ped, highly_perceptive)
        end
    end
end)

-- -- 任务实体
local MISSION_ENTITY = menu.list(entity_options, "管理任务实体", {}, "")

local MISSION_ENTITY_custom = menu.list(MISSION_ENTITY, "自定义 Model Hash", {}, "")

local custom_model_hash
menu.text_input(MISSION_ENTITY_custom, "输入 Model Hash ", { "custom_model_hash" }, "", function(value)
    custom_model_hash = tonumber(value)
end)

local custom_all_entity = entities.get_all_peds_as_handles()
menu.slider_text(MISSION_ENTITY_custom, "实体类型", {}, "点击应用修改", { "Ped", "Vehicle", "Object", "Pickup" }, function(value)
    if value == 1 then
        custom_all_entity = entities.get_all_peds_as_handles()
        util.toast("Ped")
    elseif value == 2 then
        custom_all_entity = entities.get_all_vehicles_as_handles()
        util.toast("Vehicle")
    elseif value == 3 then
        custom_all_entity = entities.get_all_objects_as_handles()
        util.toast("Object")
    elseif value == 4 then
        custom_all_entity = entities.get_all_pickups_as_handles()
        util.toast("Pickup")
    end
end)

local custom_isMission_entity = true
menu.toggle(MISSION_ENTITY_custom, "IS A MISSION ENTITY", {}, "是否为任务实体", function(toggle)
    custom_isMission_entity = toggle
end, true)

menu.divider(MISSION_ENTITY_custom, "传送到我")

local custom_entity_tpme_x = 0.0
menu.slider(MISSION_ENTITY_custom, "离我左/右的距离", { "custom_entity_tpme_x" }, "", -100.0, 100.0, 0.0, 1.0, function(value)
    custom_entity_tpme_x = value
end)

local custom_entity_tpme_y = 2.0
menu.slider(MISSION_ENTITY_custom, "离我前/后的距离", { "custom_entity_tpme_y" }, "", -100.0, 100.0, 2.0, 1.0, function(value)
    custom_entity_tpme_y = value
end)

local custom_entity_tpme_z = 0.0
menu.slider(MISSION_ENTITY_custom, "离我上/下的高度", { "custom_entity_tpme_z" }, "", -100.0, 100.0, 0.0, 1.0, function(value)
    custom_entity_tpme_z = value
end)

local custom_entity_tpme_head = 0.0
menu.slider(MISSION_ENTITY_custom, "head朝向", { "custom_entity_tpme_head" }, "Not use", -360.0, 360.0, 0.0, 10.0, function(value)
    custom_entity_tpme_head = value
end)

menu.action(MISSION_ENTITY_custom, "传送到我", {}, "", function()
    local flag = false
    if custom_model_hash then
        for k, ent in pairs(custom_all_entity) do
            local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
            if EntityHash == custom_model_hash then
                flag = true
                if custom_isMission_entity then
                    if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
                        local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), custom_entity_tpme_x, custom_entity_tpme_y, custom_entity_tpme_z)
                        ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
                    end
                else
                    local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), custom_entity_tpme_x, custom_entity_tpme_y, custom_entity_tpme_z)
                    ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
                end
            end
        end

        if not flag then
            util.toast("No this entity !")
        end

    else
        util.toast("Wrong model hash !")
    end
end)

--- ---
local MISSION_ENTITY_cargo = menu.list(MISSION_ENTITY, "CEO拉货", {}, "")

menu.action(MISSION_ENTITY_cargo, "散货板条箱 传送到我", {}, "飞机空投\nModel Hash: -265116550", function()
    local entity_model_hash = -265116550
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_cargo, "散货板条箱 传送到我", {}, "被飞机抢走\nModel Hash: 1688540826", function()
    local entity_model_hash = 1688540826
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_cargo, "散货板条箱 传送到我", {}, "被窃贼抢走\n沉船打捞\nModel Hash: -1143129136", function()
    local entity_model_hash = -1143129136
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_cargo, "追踪的车 传送到我", {}, "Trackify 在车后备箱里\nModel Hash: -1322183878", function()
    local entity_model_hash = -1322183878
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            if ENTITY.IS_ENTITY_ATTACHED(ent) then
                local attached_ent = ENTITY.GET_ENTITY_ATTACHED_TO(ent)
                local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
                ENTITY.SET_ENTITY_COORDS(attached_ent, coords.x, coords.y, coords.z, true, false, false, false)

                local pHead = ENTITY.GET_ENTITY_HEADING(PLAYER.PLAYER_PED_ID())
                ENTITY.SET_ENTITY_HEADING(attached_ent, pHead + 90.0)
            end
        end
    end
end)

menu.action(MISSION_ENTITY_cargo, "TP to Special Cargo", { "scargo" }, "Teleport to Special Cargo pickup", function()
    local cPickup = HUD.GET_BLIP_COORDS(HUD.GET_NEXT_BLIP_INFO_ID(478))
    HUD.GET_BLIP_COORDS(HUD.GET_NEXT_BLIP_INFO_ID(478))
    if cPickup.x == 0 and cPickup.y == 0 and cPickup.z == 0 then
        util.toast("No Cargo Found")
    else
        ENTITY.SET_ENTITY_COORDS(players.user_ped(), cPickup.x, cPickup.y, cPickup.z, false, false, false, false)
    end
end)

menu.action(MISSION_ENTITY_cargo, "TP to Vehicle Cargo", { "vcargo" }, "Teleport to Vehicle Cargo pickup", function()
    local vPickup = HUD.GET_BLIP_COORDS(HUD.GET_NEXT_BLIP_INFO_ID(523))
    HUD.GET_BLIP_COORDS(HUD.GET_NEXT_BLIP_INFO_ID(523))
    if vPickup.x == 0 and vPickup.y == 0 and vPickup.z == 0 then
        util.toast("No Vehicle Found")
    else
        ENTITY.SET_ENTITY_COORDS(players.user_ped(), vPickup.x, vPickup.y, vPickup.z, false, false, false, false)
    end
end)

--- ---
local MISSION_ENTITY_perico = menu.list(MISSION_ENTITY, "佩里科岛", {}, "")

menu.action(MISSION_ENTITY_perico, "佩里科岛：信号塔 传送到我", {}, "\nModel Hash: 1981815996", function()
    local entity_model_hash = 1981815996
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)

            local pHead = ENTITY.GET_ENTITY_HEADING(PLAYER.PLAYER_PED_ID())
            ENTITY.SET_ENTITY_HEADING(ent, pHead)
        end
    end
end)

menu.action(MISSION_ENTITY_perico, "佩里科岛：发电站 传送到我", {}, "\nModel Hash: 1650252819", function()
    local entity_model_hash = 1650252819
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, 1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)

            local pHead = ENTITY.GET_ENTITY_HEADING(PLAYER.PLAYER_PED_ID())
            ENTITY.SET_ENTITY_HEADING(ent, pHead)
        end
    end
end)

menu.action(MISSION_ENTITY_perico, "佩里科岛：保安服 传送到我", {}, "\nModel Hash: -1141961823", function()
    local entity_model_hash = -1141961823
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_perico, "佩里科岛：螺旋切割器 传送到我", {}, "\nModel Hash: -710382954", function()
    local entity_model_hash = -710382954
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_perico, "佩里科岛：抓钩 传送到我", {}, "\nModel Hash: -1789904450", function()
    local entity_model_hash = -1789904450
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_perico, "佩里科岛：运货卡车 传送到我", {}, "自动删除npc卡车司机\nModel Hash: 2014313426", function()
    local entity_model_hash = 2014313426
    for k, ent in pairs(entities.get_all_vehicles_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local ped = VEHICLE.GET_PED_IN_VEHICLE_SEAT(ent, -1)
            if ped > 0 then
                -- has npc in truck
                if not IS_PED_PLAYER(ped) then
                    entity.delete_entity(ped)
                end
            end

            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 3.0, 0.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)

            local pHead = ENTITY.GET_ENTITY_HEADING(PLAYER.PLAYER_PED_ID())
            ENTITY.SET_ENTITY_HEADING(ent, pHead + 90.0)
        end
    end
end)

--

menu.divider(MISSION_ENTITY_perico, "")

menu.action(MISSION_ENTITY_perico, "前置：长崎 传送到我", {}, "\nModel Hash: -1352468814", function()
    local entity_model_hash = -1352468814
    for k, ent in pairs(entities.get_all_vehicles_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 7.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)

            local pHead = ENTITY.GET_ENTITY_HEADING(PLAYER.PLAYER_PED_ID())
            ENTITY.SET_ENTITY_HEADING(ent, pHead + 180.0)
        end
    end
end)

menu.action(MISSION_ENTITY_perico, "前置：保险箱密码 传送到那里", {}, "赌场 保安队长\nModel Hash: -1109568186", function()
    local entity_model_hash = -1109568186
    for k, ent in pairs(entities.get_all_peds_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, 0.0, 0.0, 0.5)
            ENTITY.SET_ENTITY_COORDS(PLAYER.PLAYER_PED_ID(), coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_perico, "前置：等离子切割枪包裹 传送到我", {}, "\nModel Hash: -802406134", function()
    local entity_model_hash = -802406134
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 0.0, 2.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_perico, "前置：指纹复制器 传送到我", {}, "地下车库\nModel Hash: 1506325614", function()
    local entity_model_hash = 1506325614
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 0.0, 2.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_perico, "前置：割据 传送到那里", {}, "工地\nModel Hash: 1871441709", function()
    local entity_model_hash = 1871441709
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, 0.0, 0.0, 0.5)
            ENTITY.SET_ENTITY_COORDS(PLAYER.PLAYER_PED_ID(), coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_perico, "前置：武器 炸掉女武神", {}, "\nModel Hash: -1600252419", function()
    local entity_model_hash = -1600252419
    for k, ent in pairs(entities.get_all_vehicles_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local pos = ENTITY.GET_ENTITY_COORDS(ent)
            FIRE.ADD_EXPLOSION(pos.x, pos.y, pos.z, EXP_TAG_STICKYBOMB, 3.0, true, false, 0, false)
        end
    end
end)

--- ---
local MISSION_ENTITY_casion = menu.list(MISSION_ENTITY, "赌场抢劫", {}, "")

menu.action(MISSION_ENTITY_casion, "前置：保安 传送到我", {}, "侦查前置\nModel Hash: -1094177627", function()
    local entity_model_hash = -1094177627
    for k, ent in pairs(entities.get_all_peds_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, 10.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
            --ENTITY.SET_ENTITY_HEALTH(ent, 0.0)

            local pHead = ENTITY.GET_ENTITY_HEADING(PLAYER.PLAYER_PED_ID())
            ENTITY.SET_ENTITY_HEADING(ent, pHead)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：武器(车) 传送到我", {}, "国安局面包车 武器在防暴车内\nModel Hash: 1885839156", function()
    local entity_model_hash = 1885839156
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            if ENTITY.IS_ENTITY_ATTACHED(ent) then
                local attached_ent = ENTITY.GET_ENTITY_ATTACHED_TO(ent)
                local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
                ENTITY.SET_ENTITY_COORDS(attached_ent, coords.x, coords.y, coords.z, true, false, false, false)

                local pHead = ENTITY.GET_ENTITY_HEADING(PLAYER.PLAYER_PED_ID())
                ENTITY.SET_ENTITY_HEADING(attached_ent, pHead + 90.0)
            end
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：武器 传送到我", {}, "摩托车帮 长方形板条\nModel Hash: 798951501", function()
    local entity_model_hash = 798951501
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：武器(飞机) 传送到我", {}, "走私犯 水上飞机\nModel Hash: 1043222410", function()
    --Model Hash: -1628917549 (PICKUP) 炸毁飞机掉落的货物
    local entity_model_hash = 1043222410
    for k, ent in pairs(entities.get_all_vehicles_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 5.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：载具 传送到我", {}, "天威 经典版\nModel Hash: 931280609", function()
    local entity_model_hash = 931280609
    for k, ent in pairs(entities.get_all_vehicles_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)

            local pHead = ENTITY.GET_ENTITY_HEADING(PLAYER.PLAYER_PED_ID())
            ENTITY.SET_ENTITY_HEADING(attached_ent, pHead + 90.0)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：骇入装置 传送到我", {}, "FIB大楼 电脑旁边 提箱\n或者 国安局总部 服务器或桌子旁边\nModel Hash: -155327337", function()
    local entity_model_hash = -155327337
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：金库门禁卡(狱警) 传送到我", {}, "监狱巴士 监狱 狱警\nModel Hash: 1456041926", function()
    local entity_model_hash = 1456041926
    for k, ent in pairs(entities.get_all_peds_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：巡逻路线(车) 传送到我", {}, "某辆车后备箱里的箱子\nModel Hash: 1265214509", function()
    local entity_model_hash = 1265214509
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            if ENTITY.IS_ENTITY_ATTACHED(ent) then
                local attached_ent = ENTITY.GET_ENTITY_ATTACHED_TO(ent)
                local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 4.0, -1.0)
                ENTITY.SET_ENTITY_COORDS(attached_ent, coords.x, coords.y, coords.z, true, false, false, false)

                local pHead = ENTITY.GET_ENTITY_HEADING(PLAYER.PLAYER_PED_ID())
                ENTITY.SET_ENTITY_HEADING(attached_ent, pHead)
            end
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：杜根货物 全部爆炸", {}, "直升机 车 船\n一次性好像炸不完\nModel Hash: -1671539132 1747439474 1448677353", function()
    for k, ent in pairs(entities.get_all_vehicles_as_handles()) do
        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
            if EntityHash == -1671539132 or EntityHash == 1747439474 or EntityHash == 1448677353 then
                local pos = ENTITY.GET_ENTITY_COORDS(ent)
                FIRE.ADD_EXPLOSION(pos.x, pos.y, pos.z, EXP_TAG_STICKYBOMB, 3.0, true, false, 0, false)
            end
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：电钻 传送到那里", {}, "工地 找箱子里的电钻\nModel Hash: -12990308", function()
    local entity_model_hash = -12990308
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, 0.0, 0.0, 0.5)
            ENTITY.SET_ENTITY_COORDS(PLAYER.PLAYER_PED_ID(), coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：二级保安证(尸体) 传送到那里", {}, "灵车 医院 泊车员尸体\nModel Hash: 771433594", function()
    local entity_model_hash = 771433594
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, 0.0, 0.0, 0.5)
            ENTITY.SET_ENTITY_COORDS(PLAYER.PLAYER_PED_ID(), coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.divider(MISSION_ENTITY_casion, "隐迹潜踪")

menu.action(MISSION_ENTITY_casion, "前置：无人机 传送到我", {}, "纳米无人机\nModel Hash: 1657647215", function()
    -- -1285013058 无人机炸毁后掉落的零件（pickup）
    local entity_model_hash = 1657647215
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, 0.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：金库激光器 传送到我", {}, "\nModel Hash: 1953119208", function()
    local entity_model_hash = 1953119208
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.divider(MISSION_ENTITY_casion, "兵不厌诈")

menu.action(MISSION_ENTITY_casion, "前置：古倍科技套装 传送到我", {}, "\nModel Hash: 1425667258", function()
    local entity_model_hash = 1425667258
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：金库钻孔机 传送到我", {}, "全福银行\nModel Hash: 415149220", function()
    local entity_model_hash = 415149220
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：国安局套装 传送到我", {}, "警察局\nModel Hash: -1713985235", function()
    local entity_model_hash = -1713985235
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.divider(MISSION_ENTITY_casion, "气势汹汹")

menu.action(MISSION_ENTITY_casion, "前置：热能炸药 传送到我", {}, "\nModel Hash: -2043162923", function()
    local entity_model_hash = -2043162923
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：金库炸药 传送到我", {}, "要潜水下去 难找恶心\nModel Hash: -681938663", function()
    local entity_model_hash = -681938663
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -1.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "前置：加固防弹衣 传送到我", {}, "地堡 箱子\nModel Hash: 1715697304", function()
    local entity_model_hash = 1715697304
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, 0.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.divider(MISSION_ENTITY_casion, "")

menu.action(MISSION_ENTITY_casion, "赌场：小金库手推车 传送到我", {}, "\nModel Hash: 1736112330", function()
    local entity_model_hash = 1736112330
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
        if EntityHash == entity_model_hash and ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -0.5)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
        end
    end
end)

menu.action(MISSION_ENTITY_casion, "赌场：获取金库内手推车数量", {}, "先获取手推车数量才能传送\nModel Hash: 412463629, 1171655821, 1401432049", function()
    -- 手推车 实体list
    vault_trolley = {}
    local num = 0
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local EntityHash = ENTITY.GET_ENTITY_MODEL(ent)
            if EntityHash == 412463629 then
                num = num + 1
                table.insert(vault_trolley, ent)
            elseif EntityHash == 1171655821 then
                num = num + 1
                table.insert(vault_trolley, ent)
            elseif EntityHash == 1401432049 then
                num = num + 1
                table.insert(vault_trolley, ent)
            end
        end
    end
    util.toast("Number: " .. num)
    menu.set_max_value(menu_Vault_Trolley_TP, num)
end)

menu_Vault_Trolley_TP = menu.click_slider(MISSION_ENTITY_casion, "赌场：金库内手推车 传送到我", {}, "", 0, 0, 0, 1, function(value)
    if value > 0 then
        local ent = vault_trolley[value]
        if ENTITY.DOES_ENTITY_EXIST(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 2.0, -0.5)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)

            local pHead = ENTITY.GET_ENTITY_HEADING(PLAYER.PLAYER_PED_ID())
            ENTITY.SET_ENTITY_HEADING(ent, pHead + 180.0)
        else
            util.toast("实体不存在")
        end
    end
end)

-------- All Type Mission Entities --------
menu.divider(MISSION_ENTITY, "所有任务实体")

--- all entity type functions ---
function mission_entity_all(menu_parent, ent)
    menu.action(menu_parent, "检测该实体是否存在", {}, "", function()
        if ENTITY.DOES_ENTITY_EXIST(ent) then
            util.toast("实体存在")
        else
            util.toast("该实体已经不存在")
        end
    end)

    menu.toggle(menu_parent, "冻结实体", {}, "", function(toggle)
        ENTITY.FREEZE_ENTITY_POSITION(ent, toggle)
    end)

    menu.toggle_loop(menu_parent, "检测实体信息", {}, "", function(toggle)
        local modelHash = ENTITY.GET_ENTITY_MODEL(ent)
        local entity_info = "Hash: " .. modelHash .. "\nHealth: " .. ENTITY.GET_ENTITY_HEALTH(ent)

        local pos = ENTITY.GET_ENTITY_COORDS(ent)
        entity_info = entity_info .. "\nX : " .. pos.x .. "\nY : " .. pos.y .. "\nZ : " .. pos.z

        local my_pos = ENTITY.GET_ENTITY_COORDS(players.user_ped())
        entity_info = entity_info .. "\n距离: " .. vect.dist(my_pos, pos)

        directx.draw_text(0.5, 0.0, entity_info, ALIGN_TOP_LEFT, 0.7, 1, 0.8, 0, 1, true)
    end)

    menu.toggle(menu_parent, "添加地图标记 (Entity)", {}, "", function(toggle)
        if toggle then
            local blip = HUD.GET_BLIP_FROM_ENTITY(ent)
            if blip > 0 then
                HUD.SET_BLIP_DISPLAY(blip, 2)
            else
                blip = HUD.ADD_BLIP_FOR_ENTITY(ent)
                HUD.SET_BLIP_COLOUR(blip, 27)
                --
                if ENTITY.IS_ENTITY_A_PED(ent) then
                    if PED.IS_PED_IN_COMBAT(ent, players.user_ped()) then
                        HUD.SET_BLIP_COLOUR(blip, 1)
                    end
                end
                --
                if ENTITY.IS_ENTITY_A_VEHICLE(ent) then
                    local ped = VEHICLE.GET_PED_IN_VEHICLE_SEAT(ent, -1)
                    if ped then
                        if PED.IS_PED_IN_COMBAT(ped, players.user_ped()) then
                            HUD.SET_BLIP_COLOUR(blip, 1)
                        end
                    end
                end
            end
        else
            local blip = HUD.GET_BLIP_FROM_ENTITY(ent)
            if blip > 0 then
                HUD.SET_BLIP_DISPLAY(blip, 0)
            end
        end
    end)

    --menu.action(menu_parent, "添加地图标记 (Pickup)", {}, "", function()
    --    HUD.ADD_BLIP_FOR_PICKUP(ent)
    --end)
    --- ---
    menu.divider(menu_parent, "传送")
    menu.click_slider(menu_parent, "传送到我面前", {}, "", -10, 10, 2, 1, function(value)
        local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(players.user_ped(), 0.0, value, 0.0)
        ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
    end)

    menu.action(menu_parent, "传送到实体", {}, "", function()
        local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, 0.0, 0.0, 0.0)
        ENTITY.SET_ENTITY_COORDS(players.user_ped(), coords.x, coords.y, coords.z, true, false, false, false)
    end)
    --- ---
    menu.divider(menu_parent, "移动")
    menu.click_slider(menu_parent, "前/后移动", {}, "", -100, 100, 0, 1, function(value)
        local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, 0.0, value, 0.0)
        ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
    end)

    menu.click_slider(menu_parent, "左/右移动", {}, "", -100, 100, 0, 1, function(value)
        local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, value, 0.0, 0.0)
        ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
    end)

    menu.click_slider(menu_parent, "上/下移动", {}, "", -100, 100, 0, 1, function(value)
        local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, 0.0, 0.0, value)
        ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
    end)

    menu.click_slider(menu_parent, "朝向", {}, "", -360, 360, 0, 10, function(value)
        local head = ENTITY.GET_ENTITY_HEADING(ent)
        ENTITY.SET_ENTITY_HEADING(ent, head + value)
    end)
end

----- NPC -----
local MISSION_ENTITY_all_npc = menu.list(MISSION_ENTITY, "所有任务NPC", {}, "")
menu.action(MISSION_ENTITY_all_npc, "所有任务NPC数量", {}, "", function()
    local mission_entity_num = 0
    for k, ent in pairs(entities.get_all_peds_as_handles()) do
        if not IS_PED_PLAYER(ent) and ent ~= PLAYER.PLAYER_PED_ID() then
            if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
                mission_entity_num = mission_entity_num + 1
            end
        end
    end
    util.toast("Number :" .. mission_entity_num)
end)

menu.click_slider(MISSION_ENTITY_all_npc, "所有传送到我面前", {}, "", -10, 10, 2, 1, function(value)
    for k, ent in pairs(entities.get_all_peds_as_handles()) do
        if not IS_PED_PLAYER(ent) and ent ~= PLAYER.PLAYER_PED_ID() then
            if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
                local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, value, 1.0)
                ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
                util.yield(1500) -- wait 1.5s
            end
        end
    end
end)

-- 所有任务实体
mission_ent_npc_list = {}
-- 所有任务实体的menu.list
mission_ent_npc_menu_list = {}

function Clear_mission_npc_list()
    for k, v in pairs(mission_ent_npc_menu_list) do
        if v ~= nil then
            menu.delete(v)
        end
    end
    -- 所有任务实体
    mission_ent_npc_list = {}
    -- 所有任务实体的menu.list
    mission_ent_npc_menu_list = {}
end

menu.action(MISSION_ENTITY_all_npc, "获取所有任务NPC列表", {}, "", function()
    Clear_mission_npc_list()
    for k, ent in pairs(entities.get_all_peds_as_handles()) do
        if not IS_PED_PLAYER(ent) and ent ~= PLAYER.PLAYER_PED_ID() then
            if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
                table.insert(mission_ent_npc_list, ent)
                local modelHash = ENTITY.GET_ENTITY_MODEL(ent)
                local entity_info = "Hash: " .. modelHash
                if PED.IS_PED_IN_COMBAT(ent, PLAYER.PLAYER_ID()) then
                    entity_info = entity_info .. " (敌对)"
                end
                local text = "index: " .. k
                ---
                menu_mission_entity_npc = menu.list(MISSION_ENTITY_all_npc, entity_info, {}, text)
                mission_entity_all(menu_mission_entity_npc, ent)
                table.insert(mission_ent_npc_menu_list, menu_mission_entity_npc)
            end
        end
    end
end)

menu.action(MISSION_ENTITY_all_npc, "清空列表", {}, "", function()
    Clear_mission_npc_list()
end)

menu.divider(MISSION_ENTITY_all_npc, "任务NPC列表")

----- VEHICLE -----
local MISSION_ENTITY_all_vehicle = menu.list(MISSION_ENTITY, "所有任务载具", {}, "")
menu.action(MISSION_ENTITY_all_vehicle, "所有任务载具数量", {}, "", function()
    local mission_entity_num = 0
    for k, ent in pairs(entities.get_all_vehicles_as_handles()) do
        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            mission_entity_num = mission_entity_num + 1
        end
    end
    util.toast("Number :" .. mission_entity_num)
end)

menu.click_slider(MISSION_ENTITY_all_vehicle, "所有传送到我面前", {}, "", -10, 10, 2, 1, function(value)
    for k, ent in pairs(entities.get_all_vehicles_as_handles()) do
        if not IS_PED_PLAYER(ent) and ent ~= PLAYER.PLAYER_PED_ID() then
            if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
                local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, value, 0.0)
                ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
                util.yield(1500) -- wait 1.5s
            end
        end
    end
end)

-- 所有任务实体
mission_ent_vehicle_list = {}
-- 所有任务实体的menu.list
mission_ent_vehicle_menu_list = {}

function Clear_mission_vehicle_list()
    for k, v in pairs(mission_ent_vehicle_menu_list) do
        if v ~= nil then
            menu.delete(v)
        end
    end
    -- 所有任务实体
    mission_ent_vehicle_list = {}
    -- 所有任务实体的menu.list
    mission_ent_vehicle_menu_list = {}
end

menu.action(MISSION_ENTITY_all_vehicle, "获取所有任务载具列表", {}, "", function()
    Clear_mission_vehicle_list()
    for k, ent in pairs(entities.get_all_vehicles_as_handles()) do
        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            table.insert(mission_ent_vehicle_list, ent)
            local modelHash = ENTITY.GET_ENTITY_MODEL(ent)
            local entity_info = "Hash: " .. modelHash
            local text = "index: " .. k
            ---
            menu_mission_entity_vehicle = menu.list(MISSION_ENTITY_all_vehicle, entity_info, {}, text)
            mission_entity_all(menu_mission_entity_vehicle, ent)
            table.insert(mission_ent_vehicle_menu_list, menu_mission_entity_vehicle)
        end
    end
end)

menu.action(MISSION_ENTITY_all_vehicle, "清空列表", {}, "", function()
    Clear_mission_vehicle_list()
end)

menu.divider(MISSION_ENTITY_all_vehicle, "任务载具列表")

----- OBJECT -----
local MISSION_ENTITY_all_object = menu.list(MISSION_ENTITY, "所有任务物体", {}, "")
menu.action(MISSION_ENTITY_all_object, "所有任务物体数量", {}, "", function()
    local mission_entity_num = 0
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            mission_entity_num = mission_entity_num + 1
        end
    end
    util.toast("Number :" .. mission_entity_num)
end)

menu.click_slider(MISSION_ENTITY_all_object, "所有传送到我面前", {}, "", -10, 10, 2, 1, function(value)
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, value, 0.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
            util.yield(1500) -- wait 1.5s
        end
    end
end)

-- 所有任务实体
mission_ent_object_list = {}
-- 所有任务实体的menu.list
mission_ent_object_menu_list = {}

function Clear_mission_object_list()
    for k, v in pairs(mission_ent_object_menu_list) do
        if v ~= nil then
            menu.delete(v)
        end
    end
    -- 所有任务实体
    mission_ent_object_list = {}
    -- 所有任务实体的menu.list
    mission_ent_object_menu_list = {}
end

menu.action(MISSION_ENTITY_all_object, "获取所有任务物体列表", {}, "", function()
    Clear_mission_object_list()
    for k, ent in pairs(entities.get_all_objects_as_handles()) do
        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            table.insert(mission_ent_object_list, ent)
            local modelHash = ENTITY.GET_ENTITY_MODEL(ent)
            local entity_info = "Hash: " .. modelHash
            local text = "index: " .. k
            ---
            menu_mission_entity_object = menu.list(MISSION_ENTITY_all_object, entity_info, {}, text)
            mission_entity_all(menu_mission_entity_object, ent)
            table.insert(mission_ent_object_menu_list, menu_mission_entity_object)
        end
    end
end)

menu.action(MISSION_ENTITY_all_object, "清空列表", {}, "", function()
    Clear_mission_object_list()
end)

menu.divider(MISSION_ENTITY_all_object, "任务物体列表")

----- PICKUP -----
local MISSION_ENTITY_all_pickup = menu.list(MISSION_ENTITY, "所有任务拾取物", {}, "")
menu.action(MISSION_ENTITY_all_pickup, "所有任务拾取物数量", {}, "", function()
    local mission_entity_num = 0
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            mission_entity_num = mission_entity_num + 1
        end
    end
    util.toast("Number :" .. mission_entity_num)
end)

menu.click_slider(MISSION_ENTITY_all_pickup, "所有传送到我面前", {}, "", -10, 10, 2, 1, function(value)
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, value, 0.0)
            ENTITY.SET_ENTITY_COORDS(ent, coords.x, coords.y, coords.z, true, false, false, false)
            util.yield(1500) -- wait 1.5s
        end
    end
end)

-- 所有任务实体
mission_ent_pickup_list = {}
-- 所有任务实体的menu.list
mission_ent_pickup_menu_list = {}

function Clear_mission_pickup_list()
    for k, v in pairs(mission_ent_pickup_menu_list) do
        if v ~= nil then
            menu.delete(v)
        end
    end
    -- 所有任务实体
    mission_ent_pickup_list = {}
    -- 所有任务实体的menu.list
    mission_ent_pickup_menu_list = {}
end

menu.action(MISSION_ENTITY_all_pickup, "获取所有任务拾取物列表", {}, "", function()
    Clear_mission_pickup_list()
    for k, ent in pairs(entities.get_all_pickups_as_handles()) do
        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            table.insert(mission_ent_pickup_list, ent)
            local modelHash = ENTITY.GET_ENTITY_MODEL(ent)
            local entity_info = "Hash: " .. modelHash
            local text = "index: " .. k
            ---
            menu_mission_entity_pickup = menu.list(MISSION_ENTITY_all_pickup, entity_info, {}, text)
            mission_entity_all(menu_mission_entity_pickup, ent)
            table.insert(mission_ent_pickup_menu_list, menu_mission_entity_pickup)
        end
    end
end)

menu.action(MISSION_ENTITY_all_pickup, "清空列表", {}, "", function()
    Clear_mission_pickup_list()
end)

menu.divider(MISSION_ENTITY_all_pickup, "任务拾取物列表")

---

menu.divider(entity_options, "")

----- 实体信息枪 -----
local isLog_entity_info = false
menu.toggle_loop(entity_options, "实体信息枪", {}, "显示瞄准射击的实体信息", function()
    local ent = GetEntity_PlayerIsAimingAt(players.user())
    if ent ~= NULL and ENTITY.DOES_ENTITY_EXIST(ent) then
        local entity_info = ""
        local modelHash = ENTITY.GET_ENTITY_MODEL(ent)
        entity_info = entity_info .. "Model Hash: " .. modelHash

        if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
            entity_info = entity_info .. "\nIS A MISSION ENTITY"
        end

        local entity_types = { "No entity", "Ped", "Vehicle", "Object" }
        local entity_type = ENTITY.GET_ENTITY_TYPE(ent)
        entity_info = entity_info .. "\nEntity Type: " .. entity_types[entity_type + 1]

        local entity_pop_types = {
            "POPTYPE_UNKNOWN",
            "POPTYPE_RANDOM_PERMANENT",
            "POPTYPE_RANDOM_PARKED",
            "POPTYPE_RANDOM_PATROL",
            "POPTYPE_RANDOM_SCENARIO",
            "POPTYPE_RANDOM_AMBIENT",
            "POPTYPE_PERMANENT",
            "POPTYPE_MISSION",
            "POPTYPE_REPLAY",
            "POPTYPE_CACHE",
            "POPTYPE_TOOL" }
        local entity_pop_type = ENTITY.GET_ENTITY_POPULATION_TYPE(ent)
        entity_info = entity_info .. "\nEntity Population Type: " .. entity_pop_types[entity_pop_type + 1]

        entity_info = entity_info .. "\nEntity Health: " .. ENTITY.GET_ENTITY_HEALTH(ent)

        -- object
        if entity_type == 3 then
            if OBJECT.IS_OBJECT_A_PICKUP(ent) then
                entity_info = entity_info .. "\n\nIS A PICKUP"
            end
            if OBJECT.IS_OBJECT_A_PORTABLE_PICKUP(ent) then
                entity_info = entity_info .. "\nIS A PORTABLE PICKUP"
            end
        end

        if ENTITY.IS_ENTITY_ATTACHED(ent) then
            entity_info = entity_info .. "\n\nIS ENTITY ATTACHED"

            local attached_entity = ENTITY.GET_ENTITY_ATTACHED_TO(ent)
            entity_info = entity_info .. "\nAttached Entity Model Hash :" .. ENTITY.GET_ENTITY_MODEL(attached_entity)
        end

        entity_info = entity_info .. "\n\nEntity Heading: " .. ENTITY.GET_ENTITY_HEADING(ent)
        local pos = ENTITY.GET_ENTITY_COORDS(ent)
        entity_info = entity_info .. "\nX : " .. pos.x .. "\nY : " .. pos.y .. "\nZ : " .. pos.z

        directx.draw_text(0.5, 0.0, entity_info, ALIGN_TOP_LEFT, 0.7, 1, 0.8, 0, 1, true)
        --util.toast(entity_info)
        -- 记录到日志
        if isLog_entity_info then
            util.log(entity_info)
        end
    end
end)

menu.toggle(entity_options, "记录到日志", {}, "", function(toggle)
    isLog_entity_info = toggle
end)


